﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using Arction.Wpf.SignalProcessing;
using HighThroughput.Common;
using Ozone.Common;

namespace HighThroughput
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        public static string FrontServer;
        public static int handMove;
        public App()
        {
            this.Startup += new StartupEventHandler(App_Startup);

            // 为 Arction 组件设置部署密钥
            string deploymentKey = "lgCAAALkAXaVt9gBJABVcGRhdGVhYmxlVGlsbD0yMDIzLTA4LTI1I1JldmlzaW9uPTACgAZRyOTDrk5zu1A0voXNkXWslWqjCnugNU4U4A/Z0PN2G7zXB5IPg8CzR/OdN/JcmT5fMk6cJlXdr+uMZ8GJ3F41a2s5tqO76AL6C3CU1a3e3l7oA3qu8daEX56z6pPXB2TeMXS1g7t75dOKp2GQs0rZRsjPP6XAphEnRvu8/xF40Ky9loNqLtRBRVmZPMnTZ8o9njncXLyTdr5EQIR/YATYkt8nq7bR6y25jMQXSJFxwCfSMI3kRNeA54lIYfKcw6BVJPPrh76hL8jNS4StILr+QPxugOfcS1RiyZXZgqIhTHae1UJoJjzYh9cIvfgs/yG/E9s0uOMDBQ6ohyGVV8cB3wkat669sKVE52Llst3CprP09li/S/j4Z5x93OmfU3O7B6kXuTddMwXPenWu5oMdw2IsxjVWl0QvEAmnI7yft3xKncbq1hwzgjM2LM68H//K0GdATadYyJpFKdy/qz5gw/pUzW322RhUeTAv+JJKUs0DHNQxQ0QjqHhTJRyq5mA=";
            // 为全绑定图表设置部署密钥
            Arction.Wpf.ChartingMVVM.LightningChart.SetDeploymentKey(deploymentKey);
            // 为无绑定图表设置部署密钥
            Arction.Wpf.Charting.LightningChart.SetDeploymentKey(deploymentKey);
            // 为其他 Arction 组件设置部署密钥
            SignalGenerator.SetDeploymentKey(deploymentKey);
            AudioInput.SetDeploymentKey(deploymentKey);
            AudioOutput.SetDeploymentKey(deploymentKey);
            SpectrumCalculator.SetDeploymentKey(deploymentKey);
            SignalReader.SetDeploymentKey(deploymentKey);

        }
        void App_Startup(object sender, StartupEventArgs e)
        {
            globalVar.splashScreen = new SplashScreen("/Resources/Images/SplashScreen.png");
            
            globalVar.splashScreen.Show(false);
            //上面Show()方法中设置为true时，程序启动完成后启动图片就会自动关闭，
            //设置为false时，启动图片不会自动关闭，需要使用下面一句设置显示时间，例如23s
            //splashScreen.Close(new TimeSpan(0, 0, 23));
            handMove = 0;
        }
    }
}
